You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: long links wrap with an inline icon instead of cutting off - #19
A link pill is one unbreakable unit, so on mobile a long label (a thread title, a PR title) is cut off with "…" at the end of the line. This adds linkVariants[pattern].inlineIcon: the icon is drawn before the link's own text, which stays ordinary link text and wraps. Pills are unchanged, and a variant that sets pill ignores inlineIcon.
iOS [U+FFFC icon attachment][U+2060 word joiner]link text…
ENRMAttributedStringByExpandingLinkPills drops both wherever text leaves the view
(copy, Copy as Markdown, HTML/RTF export, accessibility, link titles)
Android link text is not changed
LinkIconSpan (ReplacementSpan) covers the first word and draws icon + word
ends at the first line-break opportunity, a font change, or 24 chars
applies the word's draw-only styles (link color, strikethrough)
dropped in paragraphs with right-to-left text (a replacement is bidi-neutral)
LinkFontSpan applies the link font while measuring too, so wrapped lines match drawing
Also fixes the normalized style cache: isSubStyleEqual treated { pill: undefined } as equal to a variant with a different key of the same count, so a cached style could hide a new inlineIcon.
macOS and web ignore inlineIcon, as they do pill. Docs: guides/link-pills.md#inline-icons and style-properties.md#inline-icon.
Evidence
Made-up content, in the T3 Code dev client with this branch packed (1.2.0-t3.19-6c97dc41).
Before (fork/t3-mobile)
After
iOS 27.2
Android 14
Android edge cases: a Chinese title wraps, a Hebrew title keeps its order (no icon), strikethrough and an enclosing bold reach the covered word, a leading space keeps the icon with its word, and an RTL paragraph keeps its direction.
jest: 65 suites, 1890 tests pass, including new cases in __tests__/link-pill-style.test.ts for inlineIcon normalization and the cache fix (that one fails without the styleUtils.ts change).
tsc, eslint, clang-format, ktlint, Android compileDebugKotlin and unit tests pass. iOS built in the T3 Code dev client.
On device: tapping the wrapped second line opens the link on both platforms; iOS VoiceOver link names contain no icon characters.
Not exercised on device: copy and selection, long-press menus, links in tables, a remote icon that fails to load.
Merge Danger
Door: two-way
New opt-in style key; nothing changes until a variant sets it.
Blast Radius: small
The Android LinkSpan font split and the iOS pill-expansion range remapping touch paths that pills and ordinary links also use. The cache-equality fix changes when a normalized style is reused.
The fork's README asks for an open upstream PR for each fork change; none is open yet for this one.
Model and harness: Claude Opus 5.5 in Claude Code.
Note
Add inlineIcon link variant so long links wrap instead of cutting off
Adds a new inlineIcon option to link variants (LinkInlineIconStyle with iconUri and optional iconTintColor). A variant with a pill keeps pill presentation; inline icons are dropped in that case. Docs updated in style-properties.md and link-pills.md.
On Android, LinkIconSpan in LinkIconSpan.kt reserves a font-sized slot, loads local or remote icons, and redraws or reflows when async loads finish. Icons attach to a bounded first-word run (max 24 chars) and are removed in paragraphs containing RTL text.
On iOS, ENRMLinkIconAttachment in ENRMLinkIconAttachment.m renders icons as text attachments, stripping placeholder characters from accessibility labels and link titles.
Fixes two bugs: isSubStyleEqual in styleUtils.ts now detects objects with same key count but different keys, and the iOS style fingerprint in MeasurementCache.h now includes the inline icon URI.
Behavioral Change: link text with an inlineIcon variant now wraps across lines instead of truncating; LinkSpan gained an appliesFont option so icon-bearing links measure with the link font.
A pill is one unbreakable unit, so a long label is cut off at the end of
the line. A link variant's inlineIcon draws an icon before the link's own
text, which then wraps like any other link.
iOS inserts an icon attachment and a word joiner, and drops both wherever
text leaves the view. Android draws the icon in a replacement span over
the link's first character, so the stored text is unchanged, and measures
the link with the font it draws with.
Also fixes the normalized style cache treating { pill: undefined } as
equal to a variant with a different key.
The link font is set only by LinkFontSpan for these links, so an enclosing bold
measures and draws the same. Paragraphs with right-to-left text drop the icon,
since a replacement span could change their direction.
No actionable comments were generated in the recent review.
Walkthrough
Link variants now support inline icons with configurable URIs and optional tint colors. Android and iOS render icons before eligible link text, with image loading and layout updates. iOS text expansion and label handling account for icon attachments. Tests and documentation cover the setting and its interaction with pills.
This change adds an opt-in inline icon for link variants, so long links wrap instead of truncating. Existing pill behavior is unchanged and the option is ignored when a variant sets pill. No actionable merge-blocking risk remains after the review.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: long links wrap with an inline icon instead of being cut off. The changeset adds the opt-in inlineIcon link variant style across JS types, Android LinkIconSpan/LinkRen…
Description check
The description explains the purpose (link pills are unbreakable, so long labels are truncated; inlineIcon lets link text wrap), gives a usage example, describes per-platform behavior, the styleUtils …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: long links wrap with an inline icon instead of being cut off. The changeset adds the opt-in inlineIcon link variant style across JS types, Android LinkIconSpan/LinkRenderer, and iOS ENRMLinkIconAttachment, which matches the title.
Full details: Description check
Explanation
The description explains the purpose (link pills are unbreakable, so long labels are truncated; inlineIcon lets link text wrap), gives a usage example, describes per-platform behavior, the styleUtils cache fix, and test evidence. It matches the changeset, which adds inlineIcon, LinkIconSpan, ENRMLinkIconAttachment, and the isSubStyleEqual fix.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 32cf7982-b6c9-4863-8c31-193b1f3ce446
Commits
Reviewing files that changed from the base of the PR and between a19cb78 and 3757a44.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
Brings in fork/t3-mobile's changes since this branch's base as one commit:
links wrap with an inline icon instead of a pill (#19), the off-screen code
block bitmap fix, the clipboard cleanup, and packing Package.swift.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
🤖 Written by Claude Opus 5.5 on behalf of Illia
A link pill is one unbreakable unit, so on mobile a long label (a thread title, a PR title) is cut off with "…" at the end of the line. This adds
linkVariants[pattern].inlineIcon: the icon is drawn before the link's own text, which stays ordinary link text and wraps. Pills are unchanged, and a variant that setspillignoresinlineIcon.Summary
How each platform draws it:
Also fixes the normalized style cache:
isSubStyleEqualtreated{ pill: undefined }as equal to a variant with a different key of the same count, so a cached style could hide a newinlineIcon.macOS and web ignore
inlineIcon, as they dopill. Docs:guides/link-pills.md#inline-iconsandstyle-properties.md#inline-icon.Evidence
Made-up content, in the T3 Code dev client with this branch packed (
1.2.0-t3.19-6c97dc41).fork/t3-mobile)Android edge cases: a Chinese title wraps, a Hebrew title keeps its order (no icon), strikethrough and an enclosing bold reach the covered word, a leading space keeps the icon with its word, and an RTL paragraph keeps its direction.
__tests__/link-pill-style.test.tsforinlineIconnormalization and the cache fix (that one fails without thestyleUtils.tschange).compileDebugKotlinand unit tests pass. iOS built in the T3 Code dev client.Merge Danger
Door: two-way
New opt-in style key; nothing changes until a variant sets it.
Blast Radius: small
The Android
LinkSpanfont split and the iOS pill-expansion range remapping touch paths that pills and ordinary links also use. The cache-equality fix changes when a normalized style is reused.The fork's README asks for an open upstream PR for each fork change; none is open yet for this one.
Model and harness: Claude Opus 5.5 in Claude Code.
Note
Add
inlineIconlink variant so long links wrap instead of cutting offinlineIconoption to link variants (LinkInlineIconStylewithiconUriand optionaliconTintColor). A variant with a pill keeps pill presentation; inline icons are dropped in that case. Docs updated in style-properties.md and link-pills.md.LinkIconSpanin LinkIconSpan.kt reserves a font-sized slot, loads local or remote icons, and redraws or reflows when async loads finish. Icons attach to a bounded first-word run (max 24 chars) and are removed in paragraphs containing RTL text.ENRMLinkIconAttachmentin ENRMLinkIconAttachment.m renders icons as text attachments, stripping placeholder characters from accessibility labels and link titles.isSubStyleEqualin styleUtils.ts now detects objects with same key count but different keys, and the iOS style fingerprint in MeasurementCache.h now includes the inline icon URI.inlineIconvariant now wraps across lines instead of truncating;LinkSpangained anappliesFontoption so icon-bearing links measure with the link font.Macroscope summarized 6c97dc4.